package com.itheima.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;
    private static final String PREMENT_URL = "http://consul-provider-payment";

    @GetMapping("/consumer/payment/consul")
    public String Payment() {
        return this.restTemplate.getForObject(PREMENT_URL + "/payment/consul", String.class);
    }
}
